package com.company.app.validators;

import com.company.app.entities.Product;

public class ProductValidator {
	
	public static String isProuctValid(Product product){
		StringBuilder errorMsg = new StringBuilder();
		if (product.getCode()==null || product.getCode().trim().isEmpty()){
			errorMsg.append("The code is requider");
		}
		if (product.getName()==null || product.getName().trim().isEmpty()){
			errorMsg.append("The name is requider");
		}
		if (product.getPrice()==null){
			errorMsg.append("The price is requider");
		}
		return errorMsg.toString();
	}
}
